package com.example.xd.model_video.videoeditlib;

import android.content.Context;

import com.example.xd.model_video.videoeditlib.editVideoPlay.EditVideoPlayer;
import com.example.xd.model_video.videoeditlib.magicfiltertype.MagicFilterType;

/**
 * @auther XuDan on 2019/7/16.
 */
public class AddFilterUtil implements addFilterInterface {
    Context context;

    private AddFilterUtil() {
    }

    private static AddFilterUtil instance;

    public static AddFilterUtil getInstance() {
        if (instance == null) {
            synchronized (AddFilterUtil.class) {
                instance = new AddFilterUtil();
            }
        }
        return instance;
    }

    @Override
    public void addFilter(EditVideoPlayer editVideoPlayer, MagicFilterType filterType) {
        editVideoPlayer.getmVideoView().getMovieRender().setFilter(filterType);
    }

    @Override
    public void init(Context context) {
        this.context = context;
    }
}
